#region Using

using System;
using System.IO;
using System.Net.Mail;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Globalization;
using BlogEngine.Core;

#endregion

public partial class admin_media_settings : System.Web.UI.Page
{
	protected void Page_Load(object sender, EventArgs e)
	{
		if (!IsPostBack)
			BindSettings();

		Page.MaintainScrollPositionOnPostBack = true;
		Page.Title = Resources.labels.settings;

		btnSave.Click += new EventHandler(btnSave_Click);

		btnSave.Text = Resources.labels.saveSettings;
	}

	private void btnSave_Click(object sender, EventArgs e)
	{		
		//-----------------------------------------------------------------------
		//-----------------------------------------------------------------------
		// Media Settings
		//-----------------------------------------------------------------------
		BlogSettings.Instance.PhotoUseThickBox = cbUseThickBox.Checked;
		BlogSettings.Instance.PolaroidAllowFullScreen = cbPolaroidFullScreenMode.Checked;
		
		//-----------------------------------------------------------------------
		//  Persist settings
		//-----------------------------------------------------------------------
		BlogSettings.Instance.Save();
		Response.Redirect(Request.RawUrl, true);
	}

	private void BindSettings()
	{
		//-----------------------------------------------------------------------
		// Media Settings
		//-----------------------------------------------------------------------
		cbUseThickBox.Checked = BlogSettings.Instance.PhotoUseThickBox;
		cbPolaroidFullScreenMode.Checked = BlogSettings.Instance.PolaroidAllowFullScreen;		
	}

}